@extends('backend.layouts.main')
@section('content')
    <section class="content-header">
        <h1>
            课程预约
            <small>课程预约</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{URL('admin/index')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active"><a href="{{URL('admin/courseBooking')}}">课程预约</a></li>
        </ol>

    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                <!--{!!view("backend.rotation._search",['request'=>$request])->render()!!}-->
                    <!-- /.box-header -->
                    <div class="box-body  table-responsive">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th style="width: 10px">#</th>
                                <th>学员昵称</th>
                                <th>学员头像</th>
                                <th>教练名称</th>
                                <th>课程名称</th>
                                <th>课程类型</th>
                                <th>上课地点</th>
                                <th>上课开始时间</th>
                                <th>上课结束时间</th>
                                <th>状态</th>
                                <th>预约时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            @if(!empty($courseBookingDatas[0]->id))
                                @foreach($courseBookingDatas AS $key=>$courseBookingData)
                                    <tr style="color:#888;font-weight:normal">
                                        <td></td>
                                        <td style="cursor:pointer">
                                            {{$courseBookingData->getStudentBelongsTo->nickname}}
                                        </td>
                                        <td><img src="{{$courseBookingData->getStudentBelongsTo->images}}"
                                                 style="width: 100px;height: 100px"></td>
                                        <td>{{$courseBookingData->getUserBelongsTo->name}}</td>
                                        <td>{{DANCE[$courseBookingData->dances_id]}}</td>
                                        <td>
                                            @if($courseBookingData->types==0)
                                                <span class="label label-success">团课</span>
                                            @else
                                                <span class="label label-success">私课</span>
                                            @endif
                                        </td>
                                        <td>{{$courseBookingData->getDancesBelongsTo->address}}</td>
                                        <td>{{date("Y-m-d H:i:s",$courseBookingData->begin_time)}}</td>
                                        <td>{{date("Y-m-d H:i:s",$courseBookingData->end_time)}}</td>
                                        <td>
                                            @if($courseBookingData->status==0)
                                                <span class="label label-success">已预约</span>
                                            @else
                                                <span class="label label-danger">已取消</span>
                                            @endif
                                        </td>
                                        <td>{{date("Y-m-d H:i:s",$courseBookingData->created_at)}}</td>
                                        <td>
                                            <a type="button"
                                               href="courseBooking/{{encryptionUrl($courseBookingData->id)}}"
                                               class="btn btn-success btn-sm"><i class="fa fa-eye"></i>详情</a>
                                            @if($courseBookingData->status==0)
                                                <a type="button"
                                                   onclick="delConfirm('courseBooking/{{encryptionUrl($courseBookingData->id)}}', 'courseBooking','确定取消吗？')"
                                                   class="btn btn-danger btn-sm"><i class="fa fa-close"></i>取消预约</a>
                                            @endif
                                        </td>
                                    </tr>
                                @endforeach
                            @else
                                <tr style="color:#888;font-weight:normal">
                                    <td colspan="12" align="center">暂无数据</td>
                                </tr>
                            @endif
                        </table>
                    </div>
                    {!!view("backend.common._page",['datas'=>$courseBookingDatas,'request'=>$request])->render()!!}
                </div>
            </div>
        </div>
    </section>
    {!!view("backend.common.status")->render()!!}
@endsection
